﻿using System;
using MVCms.Core.DataAccess;
using MVCms.Core.Developers;


namespace MVCms.Core.Entities
{
    [Serializable]
    public class PluginModule : BaseEntity
    {
        /// <summary>
        /// Gets or sets the plugin that this module is associated with
        /// </summary>
        /// <value>The plugin.</value>
        public virtual Plugin Plugin { get; set; }
        /// <summary>
        /// Gets or sets the full name of the controller.
        /// </summary>
        /// <value>The full name of the controller.</value>
        public virtual string ControllerFullName { get; set; }
        /// <summary>
        /// Gets or sets the controller Name.
        /// </summary>
        /// <value>The controller.</value>
        public virtual string Controller { get; set; }
        /// <summary>
        /// Gets or sets the action name.
        /// </summary>
        /// <value>The action.</value>
        public virtual string Action { get; set; }
        /// <summary>
        /// Gets or sets the controller this specific view post's to
        /// </summary>
        /// <value>The post controller.</value>
        public virtual string PostController { get; set; }
        /// <summary>
        /// Gets or sets the action this specific view post's to
        /// </summary>
        /// <value>The post action.</value>
        public virtual string PostAction { get; set; }
        /// <summary>
        /// Gets or sets the name of the module.
        /// </summary>
        /// <value>The name.</value>
        public virtual string Name { get; set; }
        /// <summary>
        /// Gets or sets the description of the module
        /// </summary>
        /// <value>The description.</value>
        public virtual string Description { get; set; }

        /// <summary>
        /// Gets the display name format({Controller}-{Action}).
        /// </summary>
        /// <value>The display name.</value>
        [McContext.IgnoreAttribute]
        public virtual string DisplayName 
        {
            get
            {
                return string.Format("{0}-{1}", Controller, Action);
            }
        }
    }
}
